load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")

go_library(
    name = "dump-inotify-event_lib",
    srcs = ["dump-inotify-event.go"],
    importpath = "go.f110.dev/heimdallr/script/dump-inotify-event",
    visibility = ["//visibility:private"],
    deps = ["//vendor/github.com/fsnotify/fsnotify"],
)

go_binary(
    name = "dump-inotify-event",
    embed = [":dump-inotify-event_lib"],
    visibility = ["//visibility:public"],
)

load("@rules_pkg//:pkg.bzl", "pkg_tar")
load("@io_bazel_rules_docker//container:container.bzl", "container_image")

pkg_tar(
    name = "bin",
    srcs = ["//script/dump-inotify-event"],
    mode = "0755",
    package_dir = "/usr/local/bin",
)

container_image(
    name = "image",
    base = "@com_google_distroless_base//image",
    entrypoint = ["/usr/local/bin/dump-inotify-event"],
    tars = [":bin"],
)
